package modelLayer;

/**
 * Tree class
 * @author Thomas Bonderup
 * @version 1.0.0
 */
public class Tree
{
    // instance variables - replace the example below with your own
    private static int staticNr = 0;
	private int treeId;
	private String sort;
    private int lifespan;
    private double costPrSquareKilometre;
    private double revenuePrSquareKilometre;

    /**
     * Constructor for objects of class Tree
     */
    public Tree(String sort, int lifespan, double costPrSquareKilometre, double revenuePrSquareKilometre)
    {
    	staticNr++;
    	treeId = staticNr;
        this.sort = sort;
        this.lifespan = lifespan;
        this.costPrSquareKilometre = costPrSquareKilometre;
        this.revenuePrSquareKilometre = revenuePrSquareKilometre;
    }

    public static int getStaticNr() {
		return staticNr;
	}

	public static void setStaticNr(int staticNr) {
		Tree.staticNr = staticNr;
	}

	public int getId() {
		return treeId;
	}

	public void setId(int treeId) {
		this.treeId = treeId;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public int getLifespan() {
		return lifespan;
	}

	public void setLifespan(int lifespan) {
		this.lifespan = lifespan;
	}

	public void setCostPrSquareKilometre(double costPrSquareKilometre) {
		this.costPrSquareKilometre = costPrSquareKilometre;
	}

	public void setRevenuePrSquareKilometre(double revenuePrSquareKilometre) {
		this.revenuePrSquareKilometre = revenuePrSquareKilometre;
	}
	
	public double getCostPrSquareKilometre(){
		return costPrSquareKilometre;
	}

	public double getRevenuePrSquareKilometre(){
		return revenuePrSquareKilometre;
	}

    public void printInformation(){
        System.out.println("#The tree is: "+sort);
		System.out.println("#And it lives for: "+lifespan+" years");
		System.out.println("#The cost is: "+costPrSquareKilometre+" pr. square kilometre");
		System.out.println("#The revenue is: "+revenuePrSquareKilometre+" pr square kilometre");
	
    }
}
